<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
/* 页面最开始条件设置  */
//选择数据集后加载数据项
function loadDataItemList(){
	var setId = $("#dataSetSelect").val();
	var dataItemSelectId = $("#dataItemSelectId").val();
	$.ajax({
		url:'${ctx}/reportTemplateConditionsController/getAllDataItemBySetId/' + setId,
		type:'POST',
		cache:false,
		success:function(data){
			var dataItemOptions = "";
		    $.each(data,function(idx,item){
		    	if(item.id==dataItemSelectId){
		    		dataItemOptions += "<option value='" + item.id + "' selected>" + item.itemChineseName + "</option>";
		    	}else{
		    		dataItemOptions += "<option value='" + item.id + "'>" + item.itemChineseName + "</option>";
		    	}
			});
		    $("#dataItemSelect option").remove();
		    dataItemOptionsFirst="<option value='0'>请选择</option>";
		    $(".dataItemSelectClass").append(dataItemOptionsFirst).append(dataItemOptions);
		}
	});
}

//选择数据集后加载时间字段选择
function loadDataItemTimeList(){
	var setId = $("#dataSetSelect").val();
	var itemStatTimeSelectId = $("#itemStatTimeSelectId").val();
	$.ajax({
		url:'${ctx}/reportTemplateConditionsController/getAllDataItemBySetId/' + setId,
		type:'POST',
		cache:false,
		success:function(data){
			var dataItemOptions = "";
		    $.each(data,function(idx,item){
		    	if(item.id==itemStatTimeSelectId){
		    		dataItemOptions += "<option value='" + item.id + "' selected>" + item.itemChineseName + "</option>";
		    	}else{
		    		dataItemOptions += "<option value='" + item.id + "'>" + item.itemChineseName + "</option>";
		    	}
			});
		    $("#itemStatTimeSelect option").remove();
		    dataItemOptionsFirst="<option value=''>请选择</option>";
		    $(".itemStatTimeSelectClass").append(dataItemOptionsFirst).append(dataItemOptions);
		}
	});
}

//选择数据集后加载单位字段选择
function loadDataItemUnitList(){
	var setId = $("#dataSetSelect").val();
	var itemUnitIdSelectId = $("#itemUnitIdSelectId").val();
	$.ajax({
		url:'${ctx}/reportTemplateConditionsController/getAllDataItemBySetId/' + setId,
		type:'POST',
		cache:false,
		success:function(data){
			var dataItemOptions = "";
		    $.each(data,function(idx,item){
		    	if(item.id==itemUnitIdSelectId){
		    		dataItemOptions += "<option value='" + item.id + "' selected>" + item.itemChineseName + "</option>";
		    	}else{
		    		dataItemOptions += "<option value='" + item.id + "'>" + item.itemChineseName + "</option>";
		    	}
		    	
			});
		    $("#itemUnitIdSelect option").remove();
		    dataItemOptionsFirst="<option value='0'>请选择</option>";
		    $(".itemUnitIdSelectClass").append(dataItemOptionsFirst).append(dataItemOptions);
		}
	});
}

/* 页面总空条件设置  */
function loadDataSetZongKong(){
	$.ajax({
		url:'${ctx}/reportTemplateConditionsController/getAllDataSet',
		type:'POST',
		cache:false,
		success:function(data){
			var dataSetOptions = "";
		    $.each(data,function(idx,item){
		    	dataSetOptions += "<option value='" + item.id + "'>" + item.chineseName + "</option>";
			});
		    $("#dataSetSelectZongkong option").remove();
		    dataSetOptionsFirst="<option value='0'>请选择</option>";
		    $(".dataSetSelectZongkongClass").append(dataSetOptionsFirst).append(dataSetOptions);
		}
	});
}
function loadDataItemListZongKong(){
	var setId = $("#dataSetSelectZongkong").val();
	$.ajax({
		url:'${ctx}/reportTemplateConditionsController/getAllDataItemBySetId/' + setId,
		type:'POST',
		cache:false,
		success:function(data){
			var dataItemOptions = "";
		    $.each(data,function(idx,item){
		    	dataItemOptions += "<option value='" + item.id + "'>" + item.itemChineseName + "</option>";
			});
		    $("#dataItemSelectZongkong option").remove();
		    dataItemOptionsFirst="<option value='0'>请选择</option>";
		    $(".dataItemSelectZongkongClass").append(dataItemOptionsFirst).append(dataItemOptions);
		}
	});
}

/* 页面行条件设置  */
function loadDataSetHang(){
	$.ajax({
		url:'${ctx}/reportTemplateConditionsController/getAllDataSet',
		type:'POST',
		cache:false,
		success:function(data){
			var dataSetOptions = "";
		    $.each(data,function(idx,item){
		    	dataSetOptions += "<option value='" + item.id + "'>" + item.chineseName + "</option>";
			});
		    $("#dataSetSelectHang option").remove();
		    dataSetOptionsFirst="<option value='0'>请选择</option>";
		    $(".dataSetSelectHangClass").append(dataSetOptionsFirst).append(dataSetOptions);
		}
	});
}
function loadDataItemListHang(){
	var setId = $("#dataSetSelectHang").val();
	$.ajax({
		url:'${ctx}/reportTemplateConditionsController/getAllDataItemBySetId/' + setId,
		type:'POST',
		cache:false,
		success:function(data){
			var dataItemOptions = "";
		    $.each(data,function(idx,item){
		    	dataItemOptions += "<option value='" + item.id + "'>" + item.itemChineseName + "</option>";
			});
		    $("#dataItemSelectHang option").remove();
		    dataItemOptionsFirst="<option value='0'>请选择</option>";
		    $(".dataItemSelectHangClass").append(dataItemOptionsFirst).append(dataItemOptions);
		}
	});
}
/* 页面列条件设置  */
function loadDataSetLie(){
	$.ajax({
		url:'${ctx}/reportTemplateConditionsController/getAllDataSet',
		type:'POST',
		cache:false,
		success:function(data){
			var dataSetOptions = "";
		    $.each(data,function(idx,item){
		    	dataSetOptions += "<option value='" + item.id + "'>" + item.chineseName + "</option>";
			});
		    $("#dataSetSelectLie option").remove();
		    dataSetOptionsFirst="<option value='0'>请选择</option>";
		    $(".dataSetSelectLieClass").append(dataSetOptionsFirst).append(dataSetOptions);
		}
	});
}
function loadDataItemListLie(){
	var setId = $("#dataSetSelectLie").val();
	$.ajax({
		url:'${ctx}/reportTemplateConditionsController/getAllDataItemBySetId/' + setId,
		type:'POST',
		cache:false,
		success:function(data){
			var dataItemOptions = "";
		    $.each(data,function(idx,item){
		    	dataItemOptions += "<option value='" + item.id + "'>" + item.itemChineseName + "</option>";
			});
		    $("#dataItemSelectLie option").remove();
		    dataItemOptionsFirst="<option value='0'>请选择</option>";
		    $(".dataItemSelectLieClass").append(dataItemOptionsFirst).append(dataItemOptions);
		}
	});
}

</script>
</head>
<body>
<input type="hidden" id="dataSetSelectId" value="${dataSetSelectId}"></input>
<input type="hidden" id="dataItemSelectId" value="${dataItemSelectId}"></input>
<input type="hidden" id="itemStatTimeSelectId" value="${itemStatTimeSelectId}"></input>
<input type="hidden" id="itemUnitIdSelectId" value="${itemUnitIdSelectId}"></input>
<ul>
   <li id="rig_header" class="conditionsLiClass">行列条件设置</li>
	<div id="rig_tag">
		<ul>
			<li class="pop-up_tag_a" id="pop-up_tag_a" onclick="jspShowTab('pop-up_tag_a');">总控条件</li>
          	<li class="pop-up_tag_hov" id="pop-up_tag_b" onclick="jspShowTab('pop-up_tag_b');">行条件</li>
          	<li class="pop-up_tag_hov" id="pop-up_tag_c" onclick="jspShowTab('pop-up_tag_c');">列条件</li>
          	<div id="pop-up_tag_a_div">
          	<li id="pop-up_tag_tab">
			<span  id="pop-up_tag_header">
		        &nbsp;&nbsp;统计信息集：
		          <select id="dataSetSelectZongkong" class="dataSetSelectZongkongClass" name="dataSetSelectZongkongName" onchange="loadDataItemListZongKong();"></select>
		      	&nbsp;&nbsp;统计信息项：
		          <select id="dataItemSelectZongkong" class="dataItemSelectZongkongClass" name="dataItemSelectZongkongName"></select>
				&nbsp;&nbsp;关系运算符：
		          <select id="logicOperationType" name="logicOperationTypeName">
					<option value="1">等于</option>
					<option value="2">大于等于</option>
					<option value="3">小于等于</option>
					<option value="4">大于</option>
					<option value="5">小于</option>
					<option value="6">不等于</option>
					<option value="7">包含</option>
					<option value="8">按左侧匹配</option>
					<option value="9">按右侧匹配</option>
				</select>
				&nbsp;&nbsp;值：<input type="text" value="" id="zongkongValue" style="width:80px;" name="zongkongValueName"></input>
				&nbsp;&nbsp;是否优先查询：
				  <select id="bracketsType" name="bracketsTypeName">
				  	<option value="0" selected>请选择</option>
					<option value="1">左括号</option>
					<option value="2">右括号</option>
				  </select>
				&nbsp;&nbsp;并且/或者：
				  <select id="connectorType" name="connectorTypeName">
				  	<option value="0" selected>请选择</option>
					<option value="1">并且</option>
					<option value="2">或者</option>
				  </select>
				<a id="but_add" href="#" onclick="addRowZongkong('zongkongtiaojianTable');"></a>
			</span>
				<table class="pop-up_table" width="99%" border="0" cellspacing="0" cellpadding="0" id="zongkongtiaojianTable">
	            	<tr>
			            <td class="td_grey_header" align="center">信息集</td>
			            <td class="td_grey_header" align="center">信息项</td>
			            <td class="td_grey_header" align="center">关系预算符</td>
			            <td class="td_grey_header" align="center">值</td>
			            <td class="td_grey_header" align="center">是否优先查询</td>
			            <td class="td_grey_header" align="center">并且/或者</td>
			            <td style="display:none">存入MAP中的ID</td>
			            <td class="td_grey_header" align="center">操作</td>
			          </tr>
		        </table>
			</li>
			</div>
			<div id="pop-up_tag_b_div" style="display:none">
				<li id="pop-up_tag_tab">
			        <span  id="pop-up_tag_header">
			        	<div>
			        		&nbsp;&nbsp;行数：
				        	<a href="#" onclick="subNum();" style="text-decoration: NONE">-</a>
							<input id="hangNum" type="text" value="1" style="width:50px; text-align:center;"/>
							<a href="#" onclick="addNum();" style="text-decoration: NONE">+</a>
					        &nbsp;&nbsp;统计信息集：
					          <select id="dataSetSelectHang" class="dataSetSelectHangClass" name="dataSetSelectHangName" onchange="loadDataItemListHang();"></select>
					      	&nbsp;&nbsp;统计信息项：
					          <select id="dataItemSelectHang" class="dataItemSelectHangClass" name="dataItemSelectHangName"></select>
							&nbsp;&nbsp;关系运算符：
					          <select id="hLogicOperationType" name="hLogicOperationTypeName">
								<option value="1">等于</option>
								<option value="2">大于等于</option>
								<option value="3">小于等于</option>
								<option value="4">大于</option>
								<option value="5">小于</option>
								<option value="6">不等于</option>
								<option value="7">包含</option>
								<option value="8">按左侧匹配</option>
								<option value="9">按右侧匹配</option>
							</select>
							&nbsp;&nbsp;值：<input type="text" value="" id="hangValue" style="width:80px;" name="hangValueName"></input>
							&nbsp;&nbsp;是否优先查询：
							  <select id="hBracketsType" name="hHracketsTypeName">
								<option value="0" selected>请选择</option>
								<option value="1">左括号</option>
								<option value="2">右括号</option>
							  </select>
			        	</div>
			        	<div>
							&nbsp;&nbsp;并且/或者：
							  <select id="hConnectorType" name="hConnectorTypeName">
							  	<option value="0" selected>请选择</option>
								<option value="1">并且</option>
								<option value="2">或者</option>
							  </select>
							<a id="but_add" href="#" onclick="addRowHang('hangtiaojianTable');"></a>
			        	</div>
						
				</span>
				<table class="pop-up_table" width="99%" border="0" cellspacing="0" cellpadding="0" id="hangtiaojianTable">
	            	<tr>
	            		<td class="td_grey_header" align="center">行数</td>
			            <td class="td_grey_header" align="center">信息集</td>
			            <td class="td_grey_header" align="center">信息项</td>
			            <td class="td_grey_header" align="center">关系预算符</td>
			            <td class="td_grey_header" align="center">值</td>
			            <td class="td_grey_header" align="center">是否优先查询</td>
			            <td class="td_grey_header" align="center">并且/或者</td>
			            <td style="display:none">存入MAP中的ID</td>
			            <td class="td_grey_header" align="center">操作</td>
			          </tr>
		        </table>
			</li>
			</div>
			<div id="pop-up_tag_c_div" style="display:none">
				<li id="pop-up_tag_tab">
			        <span  id="pop-up_tag_header">
			        	<div>
			        		&nbsp;&nbsp;列数：
							<select id="colSelect" class="colSelectClass"></select>
					        &nbsp;&nbsp;统计信息集：
					          <select id="dataSetSelectLie" class="dataSetSelectLieClass" name="dataSetSelectLieName" onchange="loadDataItemListLie();"></select>
					      	&nbsp;&nbsp;统计信息项：
					          <select id="dataItemSelectLie" class="dataItemSelectLieClass" name="dataItemSelectLieName"></select>
							&nbsp;&nbsp;关系运算符：
					          <select id="lLogicOperationType" name="lLogicOperationTypeName">
								<option value="1">等于</option>
								<option value="2">大于等于</option>
								<option value="3">小于等于</option>
								<option value="4">大于</option>
								<option value="5">小于</option>
								<option value="6">不等于</option>
								<option value="7">包含</option>
								<option value="8">按左侧匹配</option>
								<option value="9">按右侧匹配</option>
							</select>
							&nbsp;&nbsp;值：<input type="text" value="" id="lieValue" style="width:80px;" name="lieValueName"></input>
							&nbsp;&nbsp;是否优先查询：
							  <select id="lBracketsType" name="lHracketsTypeName">
							  	<option value="0" selected>请选择</option>
								<option value="1">左括号</option>
								<option value="2">右括号</option>
							  </select>
			        	</div>
			        	<div>
							&nbsp;&nbsp;并且/或者：
							  <select id="lConnectorType" name="lConnectorTypeName">
							  	<option value="0" selected>请选择</option>
								<option value="1">并且</option>
								<option value="2">或者</option>
							  </select>
							<a id="but_add" href="#" onclick="addRowLie('lietiaojianTable');"></a>
			        	</div>
						
					</span>
					<table class="pop-up_table" width="99%" border="0" cellspacing="0" cellpadding="0" id="lietiaojianTable">
		            	<tr>
		            		<td class="td_grey_header" align="center">列数</td>
				            <td class="td_grey_header" align="center">信息集</td>
				            <td class="td_grey_header" align="center">信息项</td>
				            <td class="td_grey_header" align="center">关系预算符</td>
				            <td class="td_grey_header" align="center">值</td>
				            <td class="td_grey_header" align="center">是否优先查询</td>
				            <td class="td_grey_header" align="center">并且/或者</td>
				            <td style="display:none">存入MAP中的ID</td>
				            <td class="td_grey_header" align="center">操作</td>
				          </tr>
			        </table>
				</li>
			</div>
		</ul>
	</div>
</ul>


  </div>
</div>
</body>
</html>